import request from '@/utils/request'

// 查询考试分类列表
export function listClassExamination(query) {
  return request({
    url: '/system/examinationClassification/classification/list',
    method: 'get',
    params: query
  })
}

// 新增考试分类
export function addClassExamination(data) {
  return request({
    url: '/system/examinationClassification/classification',
    method: 'post',
    data: data
  })
}

// 修改考试分类
export function updateClassExamination(data) {
  return request({
    url: '/system/examinationClassification/classification',
    method: 'put',
    data: data
  })
}

// 删除考试分类
export function delClassExamination(entityClassificationId) {
  return request({
    url: '/system/examinationClassification/classification/' + entityClassificationId,
    method: 'delete'
  })
}



// 查询考试库列表
export function listExamination(query) {
  return request({
    url: '/system/examinationClassification/examination/list',
    method: 'get',
    params: query
  })
}


// 新增考试库
export function addExamination(data) {
  return request({
    url: '/system/examinationClassification/examination',
    method: 'post',
    data: data,
  })
}

// 修改试题库
export function updateExamination(data) {
  return request({
    url: '/system/examinationClassification/examination',
    method: 'put',
    data: data
  })
}

// 删除考试库
export function delExamination(itemBankId) {
  return request({
    url: '/system/examinationClassification/examination/' + itemBankId,
    method: 'delete'
  })
}



// 查询考试详细
export function getExaminationDetail(answerId) {
  return request({
    url: '/system/examinationClassification/examination/' + answerId,
    method: 'get'
  })
}

// 查询考试大厅列表(当前考试)
export function getExamHallList(answerId) {
  return request({
    url: '/system/examinationClassification/examination/hallList',
    method: 'get',
    params: answerId
  })
}

// 查询考试大厅列表(历史考试)
export function getExamHallHistoryList(answerId) {
  return request({
    url: '/system/examinationClassification/examination/wei/hallList',
    method: 'get',
    params: answerId
  })
}


//提交考试
export function submitExamination(data) {
  return request({
    url: '/system/examinationClassification/user/joinExamination',
    method: 'post',
    data: data,
  })
}
